package com.athui.enums;

import java.util.Arrays;
import java.util.Optional;
import java.util.function.Supplier;

/**
 * @description: TODO
 * @autor: zhangzhonghui
 * @create: 2024-08-17 08:45
 * @Version: 1.0
 */
public enum FileProtocolEnums{

    FILE,
    HDFS,
    S3,
    OSS,
    OBS,
    GCS,
    S3A,
    S3N,
    S3S,
    ABFS,
    ABFSS,
    ADLS,
    ADL,
    ADLS2,
    ADLS2S,
    ADLS1,
    ADLS1S,
    ADLS_GEN2,
    ADLS_GEN2S,
    ADLS_GEN1,
    ADLS_GEN1S;

    public static FileProtocolEnums get(String obj) {
        Optional<FileProtocolEnums> first = Arrays.stream(FileProtocolEnums.values())
                .filter(val -> val.toString().equals(obj.toUpperCase())).findFirst();

        return first.orElse(FileProtocolEnums.FILE);
    }

}
